package pt.nmfa.peste.entity;

// Generated Mar 5, 2011 1:52:20 PM by Hibernate Tools 3.3.0.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Device generated by hbm2java
 */
@Entity
@Table(name = "device", catalog = "HomeDB")
public class Device implements java.io.Serializable {

	private Integer deviceId;
	private String name;
	private String type;
	private Set<DeviceActions> deviceActionses = new HashSet<DeviceActions>(0);
	private Set<StatusActions> statusActionses = new HashSet<StatusActions>(0);

	public Device() {
	}

	public Device(String name, String type) {
		this.name = name;
		this.type = type;
	}

	public Device(String name, String type, Set<DeviceActions> deviceActionses,
			Set<StatusActions> statusActionses) {
		this.name = name;
		this.type = type;
		this.deviceActionses = deviceActionses;
		this.statusActionses = statusActionses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "deviceId", unique = true, nullable = false)
	public Integer getDeviceId() {
		return this.deviceId;
	}

	public void setDeviceId(Integer deviceId) {
		this.deviceId = deviceId;
	}

	@Column(name = "name", nullable = false, length = 100)
	@NotNull
	@Length(max = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "type", nullable = false, length = 6)
	@NotNull
	@Length(max = 6)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "device")
	public Set<DeviceActions> getDeviceActionses() {
		return this.deviceActionses;
	}

	public void setDeviceActionses(Set<DeviceActions> deviceActionses) {
		this.deviceActionses = deviceActionses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "device")
	public Set<StatusActions> getStatusActionses() {
		return this.statusActionses;
	}

	public void setStatusActionses(Set<StatusActions> statusActionses) {
		this.statusActionses = statusActionses;
	}

}
